package com.chushouya.common.constant;

import com.general.framework.core.enums.IEnum;
import lombok.Getter;

import java.util.Objects;

/**
 * 菜单系统类型
 * 系统类型(1平台后台,2商家后台)
 * @author leejean team
 */
@Getter
public enum MenuSystemTypeEnum implements IEnum<Integer> {

    ADMIN_SYSTEM(1, "平台系统"),
    MERCHANT_SYSTEM(2, "商家系统");

    private Integer value;

    private String desc;


    MenuSystemTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (MenuSystemTypeEnum thisEnum : MenuSystemTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return "";
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }

}
